<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>留言板</title>
		<script type="text/javascript" src="<%=basePath%>js/jquery-1.3.1.js"></script>
			<script type="text/javascript" src="<%=basePath %>kindeditor/kindeditor-min.js"></script>
		<link rel="stylesheet" type="text/css" href="<%=basePath%>css/top.css">
		<link rel="stylesheet" type="text/css" href="<%=basePath%>css/splitPage.css">
		<link rel="stylesheet" type="text/css" href="<%=basePath%>css/liuyanban.css"/>	
		<script type="text/javascript">
			$(function(){
				$("#page").change(function(){
					var page = $("#page").val();
					window.location.href="MessageInfo!getMessageInfo?page=" + page;
				});
			});
		</script>
<script>
var editor;
KindEditor.ready(function(K) {
	editor = K.create('textarea[name="message.content"]', {
		resizeType : 1,
		allowPreviewEmoticons : false,
		allowImageUpload : false,
		width: 450, 
		height: 30,
		newlineTag : 'br',
		items: ['fontname', 'fontsize', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'emoticons', 'link']
	});
});
</script>
	</head>
	<style type="text/css">
<!--
body {
	margin: 0 auto;
	text-align: center;
	margin-top: 0px;
	padding-top: 0px;
}
-->
</style>
<body>
<div class="box">
<!--表头logo、导航条-->
	<div class="top">
		<jsp:include page="top.jsp"></jsp:include>
    </div>
<!--内容部分-->
	<div class="main">
	<s:if test="pageBean.list.size == 0">这个可以没有~~</s:if>
<s:iterator value="pageBean.list">
   <table width="100%" cellspacing="0" cellpadding="0" border="1" align="center" bordercolor="skyblue" class="biankuang">
  <tr>
    <td width="20%" height="200" rowspan="3" align="center" valign="top" bgcolor="#F6F9FE">
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="ziti2">
      <tr>
        <td width="100%" height="150" align="center"><input type="image" src="<%=basePath %>images/2_zhangjm_123.gif" /><br/><s:property value="user.userName" /></td>
      </tr>
      <tr>
        <td width="100%" height="50" align="center">邮箱:<s:property value="user.email"/></td>
      </tr>
      <tr>
        <td width="100%" align="center"><a href="MessageInfo!getMessageInfoByUserId?message.user.id=<s:property value="user.id" />">只浏览该用户留言</a></td>
      </tr>
    </table></td>
    <td width="80%" height="10"><s:property value="title"/></td>
  </tr>
  <tr valign="top">
    <td width="80%" height="174"><table class="ziti2"><tr><td><c:out value="${content}" escapeXml="false"></c:out></td></tr></table></td>
  </tr>
  <tr>
    <td width="80%"  bgcolor="#F6F9FE" align="right">发表时间:<s:property value="createDate" />
     
  </tr>
</table>
<table height="5"><tr><td></td></tr></table>
</s:iterator>
<table  height="25" width="100%" border="0" >
						<tr>
							<td width="30%" align="left">
    	共检索到
		<s:property value="pageBean.allRow" />
		条记录 
	</td>
   <td align="right" id="pagelist">
		  <ul>
		  	<li>
		  		 <select name="page" id="page">
			  	<s:iterator value="pageBean.pageNumbers" status="pageNumbers">
				  	<s:iterator value="pageBean.pageNumbers[#pageNumbers.index]">
			  		<option value="<s:property/>"><s:property/></option>
				  	</s:iterator>
			  	</s:iterator>
			</select>
		  	</li>
		    <li class="pageinfo">共<s:property value="pageBean.totalPage" />页</li>
		    <li class="pageinfo">第<s:property value="pageBean.currentPage" />页</li>
		    <s:if test="%{pageBean.currentPage != pageBean.totalPage}">
				<li><a href="MessageInfo!getMessageInfo?page=<s:property value="pageBean.totalPage"/>">尾页</a></li>
				<li><a href="MessageInfo!getMessageInfo?page=<s:property value="%{pageBean.currentPage+1}"/>">下一页</a></li>
			</s:if>
		  	<s:if test="%{pageBean.currentPage == 1}"></s:if>
		  	<s:else>
				<li><a href="MessageInfo!getMessageInfo?page=<s:property value="%{pageBean.currentPage-1}"/>">上一页</a></li>
				<li><a href="MessageInfo!getMessageInfo?page=1">首页</a></li>
			</s:else>
		  </ul>
		 
	</td>
						</tr>
					</table>
    <form action="MessageInfo!addMessageInfo" method="post">
						<table width="75%" border="0" align="left" cellpadding="1"
							cellspacing="0" class="TABLELIST" bordercolorlight="#666666" bordercolordark="#E2F4ED">
							<%--<tr width="40%">
            <td  height="50" width="20%" align="right"><font color="#874B46" size="4pt"></font></td>
            <td align="left">
              <s:if test="#session.Logined != null">
              <font color="#874B46" size="4pt">用户名：</font><s:property value="#session.Logined.userName" />
						</s:if>
						<s:else>
							<a href="<%=basePath%>jsp/login.jsp">登录</a>&nbsp;&nbsp;<a
								href="<%=basePath%>jsp/register.jsp">免费注册</a>
						</s:else>
            
            </td>
          </tr>
							--%><tr>
							  <input type="hidden" name="message.user.id" size="30" value="<s:property value="#session.Logined.id" />" />
								<td  height="50" width="20%" align="right">
								
								<font color="#874B46" size="4pt">标题：</font>
								</td>
								<td align="left">
									<input name="message.title" type="text" size="30" style="width:200px; height:26px;" />
								</td>
							</tr>
							<tr>
								<td  height="50" width="20%" align="right" valign="top">
								<font color="#874B46" size="4pt">内容：</font>
								</td>
								<td align="left">
									<textarea name="message.content" cols="60" rows="10"></textarea>
								</td>
							</tr>
							<tr>
								<td width="20%" align="right">
									&nbsp;
								</td>
								<td align="left">
									<s:if test="#session.Logined != null">
									<input type="submit" name="Submit" style="width: 60" value="提  交" />
								</s:if>
								<s:else>
									<input type="submit" name="Submit" style="width: 60" value="提  交" disabled="true" />
								</s:else>
									<input type="reset" style="width: 60" name="Submit2" value="重  置" />
								<s:if test="#session.Logined == null">
									<span class="STYLE4" style="color:#728593"><a href="<%=basePath%>jsp/login.jsp">登录</a></span>
								</s:if>
								</td>
							</tr>
						</table>
					</form>
    
	</div>
	<%--<!--版权-->
		<div class="bottom"></div>
	--%></div>

</body>
</html>
